<div ng-controller="KanjiaCtrl" ng-init="addAction()">
    <ul class="sui-breadcrumb">
        <li><a href="#/kanjia/list">{{kanjia_data.title?kanjia_data.title:'砍价'}}</a></li>
        <li class="active">
            {{!kanjia_activity_id?"创建":"edit"|translate}}
        </li>
    </ul>
    <form name="Tradeform" class="sui-form form-horizontal" novalidate>
        <div mywizard class="sui-steps">
            <step>
                <label><span class="round">1</span><span>活动设置</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step>
                <label><span class="round">2</span><span>设置商品</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step>
                <label><span class="round">3</span><span>完成</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <div stepcontent0 class="stepContent">
                <div class="stepbody">
                    <div class="control-group">
                        <label class="control-label v-top">
                            砍价标题：
                        </label>
                        <div class="controls">
                            <input id="title" type="text" name="title" ng-model="kanjia_data.title" />
                            <div ng-show="kanjia_data.title.length==0||kanjia_data.title.length>5" class="sui-msg msg-error msg-clear help-block error">
                                <div class="msg-con">活动标题不能超过5个字</div>
                                <s class="msg-icon"></s>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            起始时间：
                        </label>
                        <div class="controls">
                            <input id="start_time" ng-model="kanjia_data.start_time" datetimepicker name="start_time" required>
                            <span class="float_left" style="width:10px;">至</span>
                            <input id="end_time" ng-model="kanjia_data.end_time" datetimepicker name="end_time" required>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            砍价方式：
                        </label>
                        <div class="controls">
                            <label data-toggle="radio" class="radio-pretty inline {{kanjia_data.cut_way==1?'checked':''}}">
                                <input type="radio" name="radio" ng-model="kanjia_data.cut_way" value="1" /><span>均价砍</span>
                            </label>
                            <label data-toggle="radio" class="radio-pretty inline {{kanjia_data.cut_way==2?'checked':''}}">
                                <input type="radio" name="radio" ng-model="kanjia_data.cut_way" value="2" /><span>随机砍</span>
                            </label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label v-top">
                            需要拉人砍：
                        </label>
                        <div class="controls">
                            <input name="need_bargain_times" ng-model="kanjia_data.need_bargain_times" value="1" required> 次
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label v-top">
                            需要砍掉：
                        </label>
                        <div class="controls">
                            <input name="need_cut_off_fee" ng-model="kanjia_data.need_cut_off_fee" value="1" required> 元
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label v-top">
                            使用优惠的最低砍价次数：
                        </label>
                        <div class="controls">
                            <input name="min_bargain_times" ng-model="kanjia_data.min_bargain_times" value="0" required> 次
                        </div>
                    </div>
                </div>
                <div>
                    <button type="button" id="next1" class="sui-btn btn-primary" mywizard-next>{{'Next step'|translate}}</button>
                </div>
            </div>
            <div stepcontent1 class="stepContent">
                <div class="stepbody">
                    <choice-item item-check="itemdata(items)" mult="no" out-html="yes" class="{{bargain_rule_id?'zhide':''}}"></choice-item>
                    <table class="sui-table table-bordered" ng-show="checked_item" style="margin-top: 10px;">
                        <thead>
                            <tr>
                                <th>{{"item_image"|translate}} </th>
                                <th>{{" title"|translate}} </th>
                                <th>sku</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><img ng-src="{{checked_item.img}}" class="item-image-80" /></td>
                                <td>
                                    {{checked_item.title}}
                                    <br> {{checked_item.outer_id}}
                                </td>
                                <td style="padding:0px;">
                                    <table class="sui-table table-nobordered" style="margin:0px;">
                                        <thead>
                                            <tr>
                                                <th>＃</th>
                                                <th>{{"sku_properties"|translate}} </th>
                                                <th>{{"skus_id"|translate}} </th>
                                                <th>{{"价格"|translate}}</th>
                                                <th>{{"remark"|translate}} </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <div ng-if="!isChoseItem">
                                                        <!-- <input ng-show="!ismult" type="radio" name="radio2" ng-click="isChecked(item,sku)">
                                                        <input ng-show="ismult" type="checkbox" name="checkbox2" checklist-model="chosedItems" checklist-value="itemSku[item.item_id+'_'+sku.sku_id]"> -->
                                                    </div>
                                                </td>
                                                <td>{{checked_item.sku_data.sku_properties}}</td>
                                                <td>{{checked_item.sku_data.sku_outer_id}}</td>
                                                <td>{{checked_item.sku_data.sku_price}}</td>
                                                <td>{{checked_item.sku_data.remark}}</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div>
                    <!-- <input type="button" class="sui-btn btn-primary" value="上一步" mywizard-previous /> -->
                    <button type="button" class="sui-btn btn-primary" mywizard-previous>上一步</button>
                    <button id="kanjiaAdd" class="sui-btn btn-primary" ng-disabled="!kanjia_data.item_id && !kanjia_data.sku_id" ng-click="kanjiaAdd();">
                        保存
                    </button>
                    <!-- <button class="sui-btn btn-primary" ng-click="dazheAdd();">{{!dazhe_activity_id?"save":"edit"|translate}}</button> -->
                </div>
            </div>
            <div class="stepContent zhide">
                <div class="stepbody">
                    <div class="control-group">
                        <label class="control-label">{{'has_invoice'|translate}}：</label>
                        <div class="controls">
                            <bool-select ng-model="trade.has_invoice"></bool-select>
                        </div>
                    </div>
                    <div ng-show="trade.has_invoice">
                        <div class="control-group">
                            <label class="control-label">{{'invoice_type'|translate}}：</label>
                            <div class="controls">
                                <input type="text" name="invoice_type" value="" ng-model="trade.invoice_type" class="input-xlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">{{'title'|translate}}：</label>
                            <div class="controls">
                                <input type="text" name="invoice_title" value="" ng-model="trade.invoice_title" class="input-xlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">{{'invoice_fee'|translate}}：</label>
                            <div class="controls">
                                <input type="number" name="invoice_fee" value="" ng-model="trade.invoice_fee" class="input-xlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">{{'invoice_desc'|translate}}：</label>
                            <div class="controls">
                                <textarea type="text" name="invoice_desc" value="" ng-model="trade.invoice_desc" class="input-xlarge"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <button type="button" class="sui-btn btn-primary" mywizard-previous>{{'Last step'|translate}}</button>
                    <button type="submit" class="sui-btn btn-primary" ng-disabled="!Tradeform.$valid || !trade.orders || trade.orders.length==0 || trade.payment<=0">
                        {{'创建'|translate}}
                    </button>
                </div>
            </div>
        </div>
    </form>
</div>